<form method="POST" action="<?php echo site_url('admin/set_kenaikan_kelas/set') ?>">
    <input type="hidden" name="id_tahun" value="<?php echo $this->encrypt->encode($id_tahun) ?>" />
    <input type="hidden" name="id_kelas" value="<?php echo $this->encrypt->encode($id_kelas) ?>" />
<button name="type" value="naik" class="btn btn-info btn-rounded"><i class="iconfa-circle-arrow-up"></i> Set Naik Kelas Pada Data yang terpilih</button>
<button name="type" value="tetap" class="btn btn-danger btn-rounded"><i class="iconfa-circle-arrow-down"></i> Tetap di kelas Pada Data yang terpilih</button>
<br/>
<br/>
<h4 class="widgettitle nomargin shadowed">Data Siswa Tahun Angkatan <?php echo $tahun_pelajaran ?> Kelas <?php echo $rslt_data_siswa->row()->nama_kelas ?></h4>
<table class="table table-bordered table-striped" id="dyntable2">
    <thead>
        <tr>
            <th class="centeralign"><input type="checkbox" class="checkall" /></th>
            <th class="head0">Nomor Induk Siswa</th>
            <th class="head1">Nama Siswa</th>
            <th class="head0">Jenis Kelamin</th>
            <th class="head1">Tingkat Kelas</th>
            <th class="head1">Nilai Rata-Rata Raport</th>
        </tr>
    </thead>
    <tbody>
        <?php
        foreach ($rslt_data_siswa->result() as $value_data_kelas)
        {
            echo '<tr>';
            if($value_data_kelas->id_siswa == null && $value_data_kelas->lulus == 0)
            echo '<td class="centeralign"><input name="id_siswa[]" type="checkbox" value="'.$value_data_kelas->id.'" /></td>';
            else
            echo '<td style="text-align:center"><i class="iconfa-lock" title="sudah set kenaikan kelas"></i></td>';
            echo '<td>' . $value_data_kelas->nomor_induk . '</td>';
            echo '<td>' . $value_data_kelas->nama_siswa . '</td>';
            echo '<td>' . $value_data_kelas->jenis_kelamin . '</td>';
            echo '<td style="text-align:center">' . $value_data_kelas->tingkat_kelas . '</td>';
            echo '<td style="text-align:right">' . $value_data_kelas->nilai_rt . '</td>';
            echo '</tr>';
        }
        ?>
    </tbody>
</table>
</form>
<script type="text/javascript">
    jQuery.noConflict();

    jQuery(document).ready(function() {
//jQuery('#dyntable2').dataTable({
//            "sPaginationType": "full_numbers",
//            "aaSortingFixed": [[1, 'asc']],
//            "fnDrawCallback": function(oSettings) {
////                jQuery.uniform.update();
//            }
//        });
		
		jQuery('.checkall').click(function(){
   var parentTable = jQuery(this).parents('table');										   
   var ch = parentTable.find('tbody input[type=checkbox]');
   if(jQuery(this).is(':checked')) {			
      //check all rows in table
      ch.each(function(){ 
         jQuery(this).attr('checked',true);
         jQuery(this).parent().addClass('checked');	//used for the custom checkbox style
         jQuery(this).parents('tr').addClass('selected'); // to highlight row as selected
      });			
   } else {		
      //uncheck all rows in table
      ch.each(function(){ 
         jQuery(this).attr('checked',false); 
         jQuery(this).parent().removeClass('checked');	//used for the custom checkbox style
         jQuery(this).parents('tr').removeClass('selected');
      });	
   }
});
});
</script>